using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TVT.Common.Exceptions;
using System.Threading;
using System.Collections.Generic;
using TVT.Common.Helpers;
using TVT.UI.Helpers;
using TVT.BizLayer.Entities;
using System.IO;
using TVT.UI.EventArguments;

namespace TVT.UI.UserControls
{
    public partial class RequarePin : System.Web.UI.UserControl
    {

        public Guid guid;

        public void SetUser(Guid userId)
        {
            guid = userId;
            ViewState[WellKnownKeys.IdUserKey] = userId;
        }

        public event EventHandler OnPinEntered = null;

        public void PinEntered(UserEventArgs args)
        {
            if (OnPinEntered != null)
            {
                OnPinEntered(this, args);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                
            }
        }

        public void SendPin(object sender, EventArgs args)
        {
            if (txtPin.Text != String.Empty)
                PinEntered(new UserEventArgs() { IdUser = (Guid)ViewState[WellKnownKeys.IdUserKey] });
        }

        public void EraseMessage()
        {
            lblTransactionResultMessage.Visible = false;
        }
    }
}